package com.example.springcloudredis.employees.controller;

import com.example.springcloudredis.employees.domain.Employees;
import com.example.springcloudredis.employees.service.EmployeesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName : EmployeesController
 * @Description : 员工Controller
 * @Author : tianshuo
 * @Date: 2021-07-06 21:24
 */
@RestController
public class EmployeesController {

    @Autowired
    private EmployeesService employeesService;

    @GetMapping("/employees/{id}")
    public Employees get(@PathVariable("id") Integer id) {
        return employeesService.getEmployeesById(id);
    }

    @GetMapping("/employees1/{id}")
    public Employees get1(@PathVariable("id") Integer id) {
        return employeesService.getEmployeesById1(id);
    }

    @GetMapping("/employees2/{id}")
    public Employees get2(@PathVariable("id") Integer id) {
        return employeesService.getEmployeesById2(id);
    }
}

